﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using MAF.Common;
using Domain.Entities;
using Domain;
using Business;
using MAF.CRUD;
using System.Collections.Specialized;

namespace Web.Controller
{
    public class DealerHandler : BaseHandler<DealerInfo>
    {
        string _module = null;

        public DealerHandler()
        {
             _module = HttpContext.Current.Request["Module"];
        }

        public DealerHandler(string module)
        {
            _module = module;
        }

        protected override ICRUD<DealerInfo> GetService()
        {
            return BusinessFactory.CreateDealer(_module);
        }

        public override IList<Domain.Entities.DealerInfo> Index()
        {
            NameValueCollection nvc = HttpContext.Current.Request.Form;

            BaseQueryVo vo = new BaseQueryVo();
            vo.Name = nvc["Name"];
            vo.StringA = nvc["Url"];
            vo.StringB = nvc["Code"];

            return GetService().Index(vo);
        }
    }
}
